package org.dromara.system.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.dromara.system.domain.PayAccount;
import org.dromara.system.domain.vo.PayAccountVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.system.domain.vo.chart.AccountMoneyVo;

import java.util.List;

/**
 * 收款账号Mapper接口
 *
 * @author Gavino
 * @date 2024-10-22
 */
public interface PayAccountMapper extends BaseMapperPlus<PayAccount, PayAccountVo> {

    /**
     * 查询收款账号轮询组ID
     * @param supplierId 供应商ID
     * @return 结果
     */
    @Select("select DISTINCT b.group_id from pay_account a\n" +
        "LEFT JOIN pay_group_account b on a.account_id = b.account_id\n" +
        "where supplier_id = #{supplierId} and b.group_id is not null")
    List<Long> selectGroupIdBySupplierId(@Param("supplierId") Long supplierId);
}
